package com.itheima.dao;

import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserOrderDao {
    /**
     * 根据id查询预约信息
     * @param id
     * @return
     */
    @Select("select * from t_order where id=#{id}")
    Order findById(Integer id);

    /**
     * 新增预约
     * @param order
     * @return
     */
    @Insert("insert into t_order(member_id, orderDate, orderType, orderStatus, setmeal_id) " +
            "VALUES (#{memberId}, #{orderDate}, #{orderType}, #{orderStatus}, #{setmealId})")
    Integer add(Order order);
}
